package Test01;

import java.awt.*;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User: YKH
 * Date: 2022-05-04
 * Time: 22:57
 * author:TestGridLayout
 */
public class TestGridLayout {
    public static void main(String[] args) {
        Frame frame = new Frame("Test01");

        Button button1 = new Button("botton1");
        Button button2 = new Button("botton2");
        Button button3 = new Button("botton3");
        Button button4 = new Button("botton4");
        Button button5 = new Button("botton5");
        Button button6 = new Button("botton6");
        //设置表格布局
        frame.setLayout(new GridLayout(3,2));
        frame.setBounds(100,200,300,200);
        frame.add(button1);
        frame.add(button2);
        frame.add(button3);
        frame.add(button4);
        frame.add(button5);
        frame.add(button6);

       // frame.pack(); //自动布局
        frame.setVisible(true);
    }
}
